import React, {Component} from 'react'
import navigatorUtil from '../navigator/navigatorUtil'
import {
    View,
    Text,
    StyleSheet,
} from 'react-native'

export default class WelcomePage extends Component {
    render() {
        return <View style={styles.welcome}>
            <Text>This is Welcome Page!</Text>
        </View>
    }

    componentDidMount() {
        const {navigation} = this.props
        this.timer = setTimeout(() => {
            navigatorUtil.resetToHomePage(this.props)
        }, 1000)
    }

    componentWillUnmount() {
        this.timer && clearTimeout(this.timer)
    }
}
const styles = StyleSheet.create({
    welcome: {
        flex: 1,
        alignItems: 'center',
        justifyContent: 'center',
    }
})
